<?php
//initialize the session
session_start();

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  session_unregister('MM_Username');
  session_unregister('MM_UserGroup');
	
  $logoutGoTo = "index.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/menu.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Aduana</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function gotofocus() {
	
}
//-->
</script>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style2 {	font-family: Tahoma, Verdana, "Zurich Condensed BT";
	font-size: 14pt;
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
<!-- InstanceEndEditable -->
<link href="aduana.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!-- 

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 

//-->
</script>
<style type="text/css">
<!--
body {

}
.style1 {color: #FFFFFF}
-->
</style>
<!-- InstanceParam name="OptionalRegion1" type="boolean" value="true" --><!-- InstanceParam name="OptionalRegion2" type="boolean" value="true" --><!-- InstanceParam name="OptionalRegion3" type="boolean" value="true" -->
</head>

<body onLoad="gotofocus()">
<table width="720" height="100%" border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#333399">
  <tr>
    <td valign="top"><table width="780" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="600" valign="middle">&nbsp;</td>
        <td><table width="180" height="60" border="0" cellpadding="0" cellspacing="1" bgcolor="#757B93">
            <tr>
              <td bgcolor="#bdbdbd"><div align="center" class="logout_usr">
			    <?php if (isset($_SESSION['MM_Username'])) {
				?>
			    <a href="<?php echo $logoutAction ?>" class="logout_usr">
					<?php  echo 'logout: '.$_SESSION['MM_Username']; ?>
				  </a>			  	
			    <?php } else {?>
				  <a href="index.php" class="negritaBlanca">Login</a></div></td> 
			  <?php } ?>
            </tr>
            <tr>
              <td height="20" class="titulo_adm_actual"><!-- InstanceBeginEditable name="titulo_adm_actual" -->
                <div align="center">Acceso Restringido </div>
              <!-- InstanceEndEditable --></td>
            </tr>
        </table></td>
      </tr>
    </table>
      
      <table width="780" height="20" border="0" cellpadding="0" cellspacing="1" bgcolor="#1B01A9">
        <tr bgcolor="#000099">
		<?php if (isset($_SESSION['MM_Username']) ) { 
			echo '<td bgcolor="#757B93">&nbsp;<a href="servicio_add.php" class="menu_principal">Servicios</a>&nbsp;| &nbsp;<a href="liquidaciones.php" class="menu_principal">Liquidaciones</a>&nbsp;| &nbsp;<a href="pagos.php" class="menu_principal">Pagos</a>&nbsp;| &nbsp;<a href="basicos.php" class="menu_principal">Tablas</a>&nbsp;| &nbsp;<a href="agentes.php" class="menu_principal">Agentes</a>&nbsp;| &nbsp; <a href="informes.php" class="menu_principal">Informes</a>&nbsp;| &nbsp; <a href="permisos.php" class="menu_principal">Seguridad</a> </td>';
		} else {  
			echo '<td bgcolor="#757B93" class="menu_principal">&nbsp;Servicios &nbsp;| &nbsp;Liquidaciones&nbsp;| &nbsp;Pagos&nbsp;| &nbsp;Despachantes&nbsp;| &nbsp;Operadores &nbsp;| &nbsp;Lugares &nbsp;| &nbsp;Agentes&nbsp;| &nbsp;Seguridad</td>';						
		}?>
		<td width="178" class="negritaBlanca style1"><div align="center">
              <SCRIPT language=JavaScript><!--
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
var now = new Date();
var textout; 
var month = now.getMonth();
var date = now.getDate();
var year = now.getYear();
if (month==0) textout="Enero";
if (month==1) textout="Febrero";
if (month==2) textout="Marzo";
if (month==3) textout="Abril";
if (month==4) textout="Mayo";
if (month==5) textout="Junio";
if (month==6) textout="Julio";
if (month==7) textout="Agosto";
if (month==8) textout="Septiembre";
if (month==9) textout="Octubre";
if (month==10) textout="Noviembre";
if (month==11) textout="Diciembre";
//textout += " " + date + ", " + y2k(year);
document.write (date + " de " + textout + " de " + y2k(year) );
// -->
</SCRIPT>
          </div></td>
        </tr>
      </table>
      <table width="780" height="400" border="0" cellpadding="0" cellspacing="1">
        <tr>
          <td width="140" valign="top" bgcolor="#999999"><table width="140" border="0" cellpadding="0" cellspacing="1" bgcolor="#bdbdbd">
             
              <!-- InstanceBeginEditable name="EditRegion4" -->
              <tr>
                <td height="20" bgcolor="#757B93" class="titulo_adm_actual">&nbsp;</td>
              </tr>
              <tr>
                <td height="20" bgcolor="#999999">&nbsp; </td>
              </tr>
              <tr>
                <td height="20" bgcolor="#999999">&nbsp;</td>
              </tr>
              <tr> 
                <td height="20" bgcolor="#999999">&nbsp;</td>
              </tr>
              <!-- InstanceEndEditable -->
          </table>
          <br></td>
          <td valign="top" bgcolor="#FFFFFF"><!-- InstanceBeginEditable name="EditRegion1" -->EditRegion1<br>
              <br>
            <table width="446" border="0" align="center" cellpadding="0" cellspacing="3" bordercolor="#0066CC" bgcolor="#000099">
              <tr bgcolor="#FF9900">
                <td width="440" bgcolor="#003399"><div align="center"><span class="msg_dato_existente">No tiene acceso premitido a esta p&aacute;gina</span></div></td>
              </tr>
            </table>
            <!-- Footer -->
            <p align="center"><a href="index.php" class="normalNegrita">Login</a></p>
          &#8226;<!-- InstanceEndEditable --></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
